/**  
 * All rights Reserved, Designed By <a href="www.itttq.com" target="_blank">www.itttq.com</a>
 * @date:   2017-09-09 21:49:48
 * @Copyright: 2017 <a href="www.itttq.com" target="_blank">www.itttq.com</a> Inc. All rights reserved. 
 */
package com.itttq.kb.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.itttq.kb.model.po.TopicReplyPo;

@Mapper
public interface ITopicReplyMapper extends BaseMapper<TopicReplyPo>{
	/**
	  * 获取根据更新时间排序的N条数据：
	  * @return
	  */
	@Select("select a.id,a.topic_title,a.topic_id,a.content,a.create_time,a.is_adopt,a.number_love,a.number_reply,a.reply_ip,a.update_time,b.avatar as creator_avatar,a.creator_id,b.`name` as creator_name from kb_topic_reply a,kb_user b where a.topic_id=#{id} and a.creator_id=b.id order by update_time desc limit #{start}, #{size}") 
	public List<TopicReplyPo> getTopicReplies(@Param("id")int id, @Param("start")int start, @Param("size")int size);
}